#pragma once

#include "IXBaseObj.h"
#include "IXFont.h"
#include "IXTextEnv.h"

enum PainterFlags
{
    PF_Default      = 0x00,
    PF_TextBuffer   = 0x01,
};

/**
 *  IXPainter Interface.
 *
 */
class ExportXSkinLib IXPainter : public IXBaseObj
{
    DEF_INTERFACE(IXPainter, _T("{43F6F14D-8D53-4fc1-8B17-FFD1DCBEF69E}"));

public:

    virtual DWORD   STDMETHODCALLTYPE   get_PainterMode() = 0;
    virtual HRESULT STDMETHODCALLTYPE   put_PainterMode(IN DWORD dwMode) = 0;

    virtual HRESULT STDMETHODCALLTYPE   put_Canvas(IN XCANVAS xCanvas) = 0;
    virtual HRESULT STDMETHODCALLTYPE   get_Canvas(OUT XCANVAS* pCanvas) = 0;

    virtual HRESULT STDMETHODCALLTYPE   BitDraw(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes) = 0;
    virtual HRESULT STDMETHODCALLTYPE   DefinedAlphaDraw(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes) = 0;
    virtual HRESULT STDMETHODCALLTYPE   ValuedAlphaDraw(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN BYTE byAlphaValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE   TransparentDraw(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN COLORREF clrTrans) = 0;
    virtual HRESULT STDMETHODCALLTYPE   TransparentAlphaDraw(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN BYTE byAlphaValue, IN COLORREF clrTrans) = 0;

    virtual HRESULT STDMETHODCALLTYPE   BitDrawEx(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, ImageDrawParams* pParam, ImageDrawType type) = 0;
    virtual HRESULT STDMETHODCALLTYPE   DefinedAlphaDrawEx(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, ImageDrawParams* pParam, ImageDrawType type) = 0;
    virtual HRESULT STDMETHODCALLTYPE   ValuedAlphaDrawEx(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN BYTE byAlphaValue, ImageDrawParams* pParam, ImageDrawType type) = 0;
    virtual HRESULT STDMETHODCALLTYPE   TransparentDrawEx(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN COLORREF clrTrans, ImageDrawParams* pParam, ImageDrawType type) = 0;
    virtual HRESULT STDMETHODCALLTYPE   TransparentAlphaDrawEx(IN XIMAGE xImage, IN RECT* lpSrc, IN RECT* lpDes, IN BYTE byAlphaValue, IN COLORREF clrTrans, ImageDrawParams* pParam, ImageDrawType type) = 0;

    virtual HRESULT STDMETHODCALLTYPE   DrawIcon(XICON xIcon, RECT* lpDes) = 0;

    virtual void    STDMETHODCALLTYPE   DrawLine(POINT& PtSrc, POINT& PtDes, COLORREF clrLine) = 0;
    virtual void    STDMETHODCALLTYPE   FillRect(RECT* prc, COLORREF clr) = 0;
    virtual void    STDMETHODCALLTYPE   Rectangle(RECT* lpRect, COLORREF clrRect) = 0;
    virtual void    STDMETHODCALLTYPE   Rectangle(RECT* lpRect, COLORREF clrRect, COLORREF clrFill) = 0;
    virtual void    STDMETHODCALLTYPE   Rectangle(RECT* lpRect, COLORREF clrRect, int nBorder) = 0;
    virtual void    STDMETHODCALLTYPE   Rectangle(RECT* lpRect, COLORREF clrRect, COLORREF clrFill, int nBorder) = 0;
    virtual void    STDMETHODCALLTYPE   DrawGradient(RECT& rcRect, COLORREF rgbTop, COLORREF rgbBottom, BOOL bVert = TRUE) = 0;

    virtual void    STDMETHODCALLTYPE   DrawFocusRect(RECT* lpRect) = 0;

    virtual void    STDMETHODCALLTYPE   RoundRectangle(RECT* lpRect, COLORREF clrRect, int nWidth, int nHeight) = 0;
    virtual void    STDMETHODCALLTYPE   RoundRectangle(RECT* lpRect, COLORREF clrRect, COLORREF clrFill, int nWidth, int nHeight) = 0;

    virtual BOOL    STDMETHODCALLTYPE   XDrawText(LPCTSTR szText, size_t nLength, LPRECT prcText, IXTextEnv* pTextEnv, IXFont* pFont) = 0;
    virtual BOOL    STDMETHODCALLTYPE   XGetTextSize(LPCTSTR szText, size_t nLength, LPSIZE pTextSize, IXFont* pFont, IXTextEnv* pTextEnv) = 0;

    virtual void    STDMETHODCALLTYPE   GetTriangleSize(OUT LPSIZE pSize) = 0;
    virtual void    STDMETHODCALLTYPE   DrawTriangle(int x, int y, BOOL bUp) = 0;

};
